//Avatar

.employee_avatar_small {
  @extend .avatar-sm;
  vertical-align: middle;

  img {
    padding: 0;
    border: none;
  }
}

.employee_avatar {
  @extend .avatar-lg;
  display: block !important;
  margin: var(--#{$cdk}size-10) auto !important;
  text-align: center;
}

.avatar-xs {
  @include avatar(var(--#{$cdk}size-16), var(--#{$cdk}size-16));
}

.avatar-sm {
  @include avatar(var(--#{$cdk}size-32), var(--#{$cdk}size-32));
}

.avatar-md {
  @include avatar(var(--#{$cdk}size-48), var(--#{$cdk}size-48));
}

.avatar-lg {
  @include avatar(var(--#{$cdk}size-80), var(--#{$cdk}size-80));
}

.avatar-xl {
  @include avatar(var(--#{$cdk}size-128), var(--#{$cdk}size-128));
}

#employee-thumbnail {
  position: relative;
  width: 100px;
  height: 100px;
  margin-bottom: var(--#{$cdk}size-10);
  // stylelint-disable-next-line
  background-image: url();
  background-size: contain;
  border: solid 1px var(--#{$cdk}primary-500);
  @include box-shadow(var(--#{$cdk}white) 0 0 0 4px inset);

  &::before {
    @extend .icon;
    @extend .icon-spin;
    @extend .icon-refresh;
    position: absolute;
    top: var(--#{$cdk}size-10);
    z-index: 10;
    display: block;
    font-size: 2em;
    color: var(--#{$cdk}primary-500);
    text-align: center;
    @include left(var(--#{$cdk}size-10));
  }

  a {
    position: absolute;
    top: var(--#{$cdk}size-1);
    z-index: 100;
    display: block;
    width: 100px;
    height: 100px;
    overflow: hidden;
    background-position: center;
    background-size: contain;
    border: none;
    @include left(var(--#{$cdk}size-1));
    @include box-shadow(white 0 0 0 var(--#{$cdk}size-4) inset);
  }
}

.message-item-initial {
  h2 {
    font-size: 1.5em;
    @include margin(0, 0, var(--#{$cdk}size-5), 0);
  }

  .message-item-initial-body {
    @extend .panel;
    position: relative;
    margin-top: var(--#{$cdk}size-10);
  }

  .message-date {
    margin-bottom: var(--#{$cdk}size-10);
    color: var(--#{$cdk}primary-500);
  }
  //Messages
}

.message-item {
  @extend .media;
  position: relative;
  padding: var(--#{$cdk}size-10) 0;
  border-bottom: solid 1px var(--#{$cdk}primary-300);
  @include margin(0, 0, 0, var(--#{$cdk}size-30));

  &:last-child {
    border: none;
  }

  .message-item-heading {
    display: inline-block;
  }

  .message-body {
    @include margin(0, 0, 0, var(--#{$cdk}size-80));

    .message-item-text {
      @include padding(0, 0, 0, var(--#{$cdk}size-10));
      @include border-left(var(--#{$cdk}size-2) solid var(--#{$cdk}primary-500));
    }
  }

  .message-avatar {
    position: absolute;
    top: var(--#{$cdk}size-10);
    @include left(var(--#{$cdk}size-10));
  }

  .message-date {
    color: #bbb;
  }
  //Arrows
}

.arrow::before,
.arrow::after {
  position: absolute;
  display: inline-block;
  content: "";
  border-color: transparent;
  border-style: solid;
}

.arrow-left::before {
  top: 6px;
  @include ltr () {
    border-width: var(--#{$cdk}size-8) var(--#{$cdk}size-8) var(--#{$cdk}size-8) 0;
    border-right-color: #d1d4d7;
  }
  @include rtl () {
    border-width: var(--#{$cdk}size-8) 0 var(--#{$cdk}size-8) var(--#{$cdk}size-8);
    border-left-color: #d1d4d7;
  }
  @include margin-left(calc(-1 * var(--#{$cdk}size-8)));
  @include left(0);
}

.arrow-left::after {
  top: var(--#{$cdk}size-8);
  @include ltr () {
    border-width: var(--#{$cdk}size-6) var(--#{$cdk}size-6) var(--#{$cdk}size-6) 0;
    border-right-color: var(--#{$cdk}white);
  }
  @include rtl () {
    border-width: var(--#{$cdk}size-6) 0 var(--#{$cdk}size-6) var(--#{$cdk}size-6);
    border-left-color: var(--#{$cdk}white);
  }
  @include left(0);
  @include margin-left(calc(-1 * var(--#{$cdk}size-6)));
}

.arrow-right::before {
  top: var(--#{$cdk}size-6);
  @include ltr () {
    border-width: var(--#{$cdk}size-8) 0 var(--#{$cdk}size-8) var(--#{$cdk}size-8);
    border-left-color: var(--#{$cdk}primary-400);
  }
  @include rtl () {
    border-width: var(--#{$cdk}size-8) var(--#{$cdk}size-8) var(--#{$cdk}size-8) 0;
    border-right-color: var(--#{$cdk}primary-400);
  }
  @include right(0);
  @include margin-right(calc(-1 * var(--#{$cdk}size-8)));
}

.arrow-right::after {
  top: var(--#{$cdk}size-8);
  @include ltr () {
    border-width: var(--#{$cdk}size-6) 0 var(--#{$cdk}size-6) var(--#{$cdk}size-6);
    border-left-color: var(--#{$cdk}white);
  }
  @include rtl () {
    border-width: var(--#{$cdk}size-6) var(--#{$cdk}size-6) var(--#{$cdk}size-6) 0;
    border-right-color: var(--#{$cdk}white);
  }
  @include right(0);
  @include margin-right(calc(-1 * var(--#{$cdk}size-6)));
}
//Timeline
$time-icon-size: 40px;

.timeline {
  position: relative;
  display: table;
  width: 100%;
  table-layout: fixed;
  border-spacing: 0;
  border-collapse: collapse;

  &::before {
    position: absolute;
    top: 0;
    bottom: var(--#{$cdk}size-30);
    z-index: 0;
    width: var(--#{$cdk}size-6);
    content: "";
    background-color: var(--#{$cdk}primary-400);
    @include margin-left(calc(-1 * var(--#{$cdk}size-4)));
    @include left(50%);
  }

  .timeline-item {
    display: table-row;

    .timeline-caption {
      display: table-cell;
      width: 50%;
      vertical-align: top;

      .timeline-panel {
        @extend .panel;
        position: relative;
        display: inline-block;
        @include text-align(left);
        @include margin-left($time-icon-size + 2px);
        @include box-shadow(0);
      }

      h5 {
        margin: 0;

        span {
          display: block;
          margin-bottom: var(--#{$cdk}size-4);
          font-size: var(--#{$cdk}size-12);
          color: var(--#{$cdk}primary-500);
        }
      }

      p {
        margin-top: var(--#{$cdk}size-10);
        margin-bottom: 0;
        font-size: var(--#{$cdk}size-12);
      }
    }

    .timeline-date {
      position: absolute;
      top: var(--#{$cdk}size-10);
      width: 150px;
      @include text-align(right);
      @include left(-220px);
    }

    .timeline-icon {
      position: absolute;
      top: calc(-1 * var(--#{$cdk}size-2));
      width: $time-icon-size;
      height: $time-icon-size;
      line-height: $time-icon-size;
      text-align: center;
      background-color: var(--#{$cdk}primary-600);
      border: var(--#{$cdk}size-2) solid var(--#{$cdk}white);
      border-radius: $time-icon-size;
      @include left(-($time-icon-size + $time-icon-size / 2 + 2px));

      i {
        margin-top: var(--#{$cdk}size-5);
        font-size: ($time-icon-size / 2);
        color: var(--#{$cdk}white);
      }
    }

    &::before,
    &.alt::after {
      display: block;
      width: 50%;
      content: "";
    }

    &.alt {
      @include text-align(right);

      &::before {
        display: none;
      }

      .timeline-panel {
        @include margin-right($time-icon-size);
        @include margin-left(0);
      }

      .timeline-date {
        @include right(-220px);
        @include text-align(left);
        @include left(auto);
      }

      .timeline-icon {
        @include left(auto);
        @include right(-($time-icon-size + $time-icon-size / 2));
      }
    }

    &.active {
      display: table-caption;
      text-align: center;

      &::before {
        width: 1%;
      }

      .timeline-panel {
        @include margin-left(0);
      }

      .timeline-caption {
        display: inline-block;
        width: auto;
      }

      .timeline-date,
      .timeline-icon {
        position: static;
        display: inline-block;
        width: auto;
        margin-bottom: var(--#{$cdk}size-10);
      }
    }
  }
}

.command-danger {
  background-color: $brand-danger !important;
}

.command-success {
  background-color: $brand-success !important;
}
